import React from 'react';

import BaseExecuter from '../common/BaseExecuter';
import DataManager from '../../datas/DataManager';
import Constants from '../../common/Constants';

export default class VipSerCardExecuter extends BaseExecuter {
  execute(action) {
    switch (action.name) {
      case "VipActivityRequestListAction":
        this._requesList(action);
        break;
      case "VipActRequestContentAction":
        this._requestActContent(action);
        break;
      case "CreateSuggestAction":
        this._createSuggest(action);
        break;
    }
  }

  _requestActContent(action){
    this._sendRequestCommonResponse(action, "requestActContent");
  }

  _requesList(action) {
    this._sendRequestCommonResponse(action, "requestList");
  }

  _getModuleType() {
    return Constants.MODULE_TYPE.VIPSERCARD;
  }

  _createSuggest(action) {
    var data = action.data;
    DataManager.callMethod(Constants.MODULE_TYPE.VIPSERCARD,
      "createSuggest",
      [data, (data, isSucceed)=>{action.finish(data, isSucceed)}]);
  }

}
